package com.sunhy.cpdemo1.repository;

import com.sunhy.cpdemo1.common.CpAnnotation;
import com.sunhy.cpdemo1.entity.Article;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class ArticleRepository {

    @CpAnnotation(sql = "select * from article", type = "SELECT")
    public List<Article> getAll() {
        return null;
    }

    @CpAnnotation(sql = "INSERT INTO `article`(`author`, `title`, `content`, `date`) VALUES ('张三', '一个咸鱼的自我修养', '做人如果冇梦想,同条咸鱼有乜分别啊?', '2021-10-31 16:29:05');", type = "INSERT")
    public Integer insert() {
        return null;
    }

    @CpAnnotation(sql = "", type = "INSERT_2")
    public Integer insertByEntity(Article article) {
        return null;
    }

}
